package com.cz.rabbitmq;


import com.cz.rabbitmq.service.MsgService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.concurrent.CountDownLatch;

public class ReceiveApplication {

    public static void main(String[] args) {
        try {
            CountDownLatch countDownLatch = new CountDownLatch(1);
            ApplicationContext applicationContext = new AnnotationConfigApplicationContext("com.cz.rabbitmq");
            MsgService msgService = applicationContext.getBean(MsgService.class);
            msgService.receiveMsg();
            countDownLatch.await();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
